﻿<?php //Seyret Component v.0.3//
/**
* @package Seyret
* @version 0.3
* @copyright Copyright (C) 2008 Mustafa DINDAR. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Seyret Video Component is a free software.
* See seyrettos.html for license notices and details.
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );


$document = & JFactory::getDocument();

$jslink=JURI :: root()."components/com_seyret/includes/js/jquery-ui-1.7.2.custom.min.js";
$document->addScript($jslink);


echo $this->toolbar;
echo $this->modtoolbar;

?>
<script type="text/javascript">
	jQuery(function() {
		index = jQuery.cookie('userdetstab');
		if (!index) index = 0;
		
		jQuery("#tabsvideodets").tabs({ cookie: { expires: 30, name: 'userdetstab', path: '/' },  selected: index });
	});
</script>


<div class="uservideolistuserprofile">
	<div class="uservideolistsectitle" style="float:none;"><?php echo $this->username;?></div>
	<div><?php echo $this->useravatar;?></div>
	<div><?php echo JText::_('Videos').": ".$this->ownervideocount;?></div>

	<div>	<?php
	if ($this->registry->getValue('seyret.user.profilelink')!="none") {
		?><a href="<?php echo $this->profilelink;?>"><?php echo JText::_('Check Profile'); ?></a><?php
	}
	
	?></div>

</div>




<div class="uservideolisttabs">

	<div class="jquerytabs">

		<div id="tabsvideodets">
			<ul>
			
				<li><a href="#tabs-2"><?php echo JText::_('Favorites');?></a></li>
				<li><a href="#tabs-3"><?php echo JText::_('Playlists');?></a></li>
				<li><a href="#tabs-4"><?php echo JText::_('Channels');?></a></li>

			</ul>

			<div id="tabs-2"  >
				
				<div class="userpageuserfavlist">	
					<div style="width:<?php echo count($this->favoritevideos) * 180 ; ?>px; min-width:400px;">	
						<?php
						
						if (count($this->favoritevideos) == 0) echo  JText::_('User doesnt have any favorites');
						foreach ($this->favoritevideos as $favoritevideos) {
						?>
						
						<div class="listedvideolistvideomc" style="height:140px;">
							<div class="" >
								<div class="listedvideolisttitledivmc" >
									<a href="<?php echo $favoritevideos->videolink;?>" style="font-weight:bold;">
										<?php echo $favoritevideos->videotitle;?>
									</a>
								</div>
							</div>
							
							<div class="">
								<div class="" style="height:120px;">
									<div class="listedvideolistthumbdivmc">
										<a href="<?php echo $favoritevideos->videolink;?>">
											<img class="listedvideolistthumbnailmc" src="<?php echo $favoritevideos->videothumbnail;?>" alt=""/> 
										</a>

										<div class="listedvideolistdurationdivmc"><?php echo $favoritevideos->duration;?>
										</div>
										
									</div>
									<div style="clear:both;"></div>


									
								</div>
							</div>
							
						</div>
						


						<?php	
			 
						
						}							
									
									
						?>
									
								
					</div>	
					<div style="clear:both;"></div>
				</div>
			</div>
			<div id="tabs-3"  >
				
				<div class="userpageuserplaylists">	
					<div style="width:<?php echo count($this->userplaylists) * 180 ; ?>px; min-width:400px;">	
						<?php
						
						if (count($this->userplaylists) == 0) echo  JText::_('User doesnt have any playlists');
						foreach ($this->userplaylists as $userplaylists) {

						?>
						
						<div class="listedvideolistvideomc" style="height:140px;">
							<div class="" >
								<div class="listedvideolisttitledivmc" >
									<a href="<?php echo $userplaylists->playlistlink;?>" style="font-weight:bold;">
										<?php echo $userplaylists->playlisttitle;?>
									</a>
								</div>
							</div>
							
							<div class="">
								<div class="" style="height:120px;">
									<div class="listedvideolistthumbdivmc">
										<a href="<?php echo $userplaylists->playlistlink;?>">
											<img class="listedvideolistthumbnailmc" src="<?php echo $userplaylists->playlistthumbnail;?>" alt=""/> 
										</a>


									</div>
									<div style="clear:both;"></div>


									
								</div>
							</div>
							
						</div>
						


						<?php	
			 
						
						}							
									
									
						?>
									
								
					</div>	
					<div style="clear:both;"></div>
				</div>
							
							
							
							
			<div style="clear:both;"></div>
			</div>
			<div id="tabs-4"  >
				
					<div class="userpageuserchannellist">	
						<div style="width:<?php echo count($this->userchannels) * 130 ; ?>px; min-width:400px;">
						<?php

						
						if (count($this->userchannels) == 0) echo  JText::_('User doesnt have any channels');
						foreach ($this->userchannels as $userchannel) {
							
						?>	
							<div class="userpageuserchannelitem">

								<a href="<?php echo $this->absURL("index.php?option=com_seyret&amp;view=channel&amp;id=". $userchannel->id); ?>"><img class="userpageuserchannelitemimage" src="<?php echo $userchannel->channelimage; ?>" alt="" /></a>
								<div class="userpageuserchannelitemtitle">	<a href="<?php echo $this->absURL("index.php?option=com_seyret&amp;view=channel&amp;id=". $userchannel->id); ?>"><?php echo $userchannel->channeltitle; ?></a></div>
								<div class="userpageuserchannelitemtitle"><?php echo JText::_('Video count')." : " . $userchannel->videocount; ?></div>
								
								<div style="clear:both;"></div>
		
						
							
							</div>
							
						<?php
						}
					
					?>						
								
								
								
					<div style="clear:both;"></div>
					</div>
				</div>
			</div>

			
		</div>

	</div>

</div>


<div style="clear:both;"></div>


<div style="border-top:1px solid #CCCCCC;">

	<div class="uservideolistsectitle" style="float:left;">	
		<?php echo JText::_('User videos');?>
	</div>
	
	
	<div>
		<div style="float:right; margin:10px;">
			<?php
			
				//create switch button here
				if ($this->uservldisplay=="oc") {
				?>
				<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=user&id=".$this->uid."&uvld=multi");?>">
					<img src="<?php echo JURI::root()."components/com_seyret/themes/default/images/switchmulti.png";?>" alt="" />
				</a>
				
				<?php
				
				} else {
				?>
				<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=user&id=".$this->uid."&uvld=oc");?>">
					<img src="<?php echo JURI::root()."components/com_seyret/themes/default/images/switchoc.png";?>" alt="" />
				</a>
				
				<?php							
				}
			
			?>

		</div>
		<div style="clear:both;"></div>
	</div>


		
	<?php

	//generate one column view
	if ($this->uservldisplay == "oc") {
	
		foreach ($this->uservideoslist as $uservideo) {
		
			$safevideotitle = str_replace("'", "\'", $uservideo->videotitle);
			$safevideotitle = str_replace("\"", "&quot;", $safevideotitle);				
		
			$inql = false;
			if (in_array($uservideo->id, $this->quicklistarray)) {
				$inql = true;			
			}

		?>
		
		<div class="listedvideolistvideooc">
			<div class="listedvideolistinfooc">

				<div class="listedvideolisttitledivoc">
					<a href="<?php echo $uservideo->videolink;?>" style="font-weight:bold;">
						<?php echo $uservideo->videotitle;?>
					</a>
				</div>
				<div class="listedvideolistdescdivoc">
					<?php echo $uservideo->videodescription;?>
				</div>
				<div class="listedvideolistfootdivoc">
					<?php echo JText::_('Added Date');?>: <?php echo $uservideo->addeddate;?>   - <?php echo JText::_('Duration');?>: <?php echo $uservideo->duration;?>
				</div>
				
			</div>
			
			<div class="listedvideolistthumbdivoc">
				<a href="<?php echo $uservideo->videolink;?>">
					<img class="listedvideolistthumbnailoc" src="<?php echo $uservideo->videothumbnail;?>" alt=""/> 
				</a>
				<div id="uvaddtoqlbdiv<?php echo $uservideo->id; ?>" style="margin-top:-22px; padding-left:5px; z-index:9999;">

					<img id="uvaddtoqlimg_js_<?php echo $uservideo->id; ?>" class="addtoquicklistbutton" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/add_ql.png";?>" alt="" onclick="jQuery.seyrettools.addtoquicklist('<?php echo $uservideo->id; ?>', '<?php echo htmlentities($uservideo->videothumbnail);?>', '<?php echo $safevideotitle; ?>', '<?php echo $uservideo->videonojxlink; ?>')" style="visibility:<?php echo ($inql==false)? 'visible' : 'hidden';?>;"/>
					<img id="uvaddtoqlimg_js_rem<?php echo $uservideo->id; ?>" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/added_ql.png";?>" alt="" style="visibility:<?php echo $inql==false ? 'hidden' : 'visible';?>; margin-left:-16px;"/>

				</div>						
			</div>

			<div class="listedvideolistextrasdivoc">

					
					<?php echo $uservideo->useravatar; ?><br/>
					<?php echo $uservideo->usernamelinked; ?>
					<div style="">
						<?php echo $uservideo->votestars; ?>
						<div class="clear"></div>
					</div>
					
					<?php echo JText::_('Views');?> : <?php echo $uservideo->hits; ?>
											
					
				
			</div>					

			
			<div class="clear"></div>
		</div>



		<?php	

		
		}
				
	} else {

		foreach ($this->uservideoslist as $uservideo) {
		
			$safevideotitle = str_replace("'", "\'", $uservideo->videotitle);
			$safevideotitle = str_replace("\"", "&quot;", $safevideotitle);				
		
			$inql = false;
			if (in_array($uservideo->id, $this->quicklistarray)) {
				$inql = true;			
			}

		?>
		
		<div class="listedvideolistvideomc">
			<div class="backgroundpadding">
				<div class="listedvideolisttitledivmc">
					<a href="<?php echo $uservideo->videolink;?>" style="font-weight:bold;">
						<?php echo $uservideo->videotitle;?>
					</a>
				</div>
			</div>
			
			<div class="backgroundpadding">
				<div class="listedvideolistbodymc">
					<div class="listedvideolistthumbdivmc">
						<a href="<?php echo $uservideo->videolink;?>">
							<img class="listedvideolistthumbnailmc" src="<?php echo $uservideo->videothumbnail;?>" alt=""/> 
						</a>
						<div id="uvaddtoqlbdiv<?php echo $uservideo->id; ?>" class="videolistqlbtnmc">

							<img id="uvaddtoqlimg_js_<?php echo $uservideo->id; ?>" class="addtoquicklistbutton" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/add_ql.png";?>" alt="" onclick="jQuery.seyrettools.addtoquicklist('<?php echo $uservideo->id; ?>', '<?php echo htmlentities($uservideo->videothumbnail);?>', '<?php echo $safevideotitle; ?>', '<?php echo $uservideo->videonojxlink; ?>')" style="visibility:<?php echo ($inql==false)? 'visible' : 'hidden';?>;"/>
							<img id="uvaddtoqlimg_js_rem<?php echo $uservideo->id; ?>" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/added_ql.png";?>" alt="" style="visibility:<?php echo $inql==false ? 'hidden' : 'visible';?>; margin-left:-16px;"/>

						</div>	

						<div class="listedvideolistdurationdivmc"><?php echo $uservideo->duration;?>
						</div>
						
					</div>
					<div style="clear:both;"></div>
					<div class="listedvideolistvotestarsmc">
						<?php echo $uservideo->votestars; ?>
						<div class="clear"></div>
					</div>
					
					<div class="listedvideousernamemc">
						<?php echo $uservideo->usernamelinked; ?>
					</div>
					
					<div class="listedvideoaddeddatemc">
						<?php echo $uservideo->addeddate; ?>
					</div>
					
					<div class="clear"></div>

					<div class="listedvideousernamemc">
						<?php echo JText::_('Views');?>: <?php echo $uservideo->hits; ?>
					</div>
					
					<div class="listedvideoaddeddatemc">
						<?php echo JText::_('Comments');?>: <?php echo $uservideo->commentcount; ?>
					</div>
					
					<div class="clear"></div>

					
				</div>
			</div>
		</div>
		


		<?php	

		
		}			
	
	
	}
	
	
	?>
	
	<div class="clear"></div>
	<div class="paginatordiv">
	
		<?php echo $this->uvlpageNav; ?>
	
	</div>		
				
	<div style="clear:both;"></div>	

</div>